#ifndef SHELL_H
#define SHELL_H

#include <QObject>
#include <QVector>
#include <QMutex>
#include <QWaitCondition>

class Shell : public QObject
{
    Q_OBJECT

    QVector<bool> m_shell;
    QMutex m_mux;
    QWaitCondition m_con;
    int m_limit;

public:
    explicit Shell(int limit, QObject *parent = 0);

    int size();
    int try_push_book();
    bool try_asquire_for_read(int pos);
    void try_asquire_for_write(int pos);
    void release_book(int pos);

signals:
    void book_added(int s);
};

#endif // SHELL_H
